import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state:()=>{
    return{
      id:null,
      username:null,
      name:null
    }
  },
  actions:{
    setUser(userObject){
      for (const key in userObject) {
        if (Object.hasOwnProperty.call(userObject, key)) {
          this[key] = userObject[key];
        }
      }
    }
  }
})
